<!--
 * FilePath     : \src\App.vue
 * Author       : SJZ
 * Date         : 2025-03-12 19:28
 * LastEditors  : SJZ
 * LastEditTime : 2025-04-03 23:12
 * Description  : 系统入口
 * CodeIterationRecord: 
 -->
<template>
  <div
    class="wh-full"
    v-loading.body="sessionStore.loading > 0"
    element-loading-background="rgba(0, 0, 0, 0.7)"
    :element-loading-text="sessionStore.loadingText"
  >
    <router-view></router-view>
  </div>
</template>
<script setup lang="ts">
const { sessionStore } = useStore();

// 禁止拖拽打开新页面
document.body.ondragover = (event) => {
  event.preventDefault();
  event.stopPropagation();
};
// 禁用浏览器默认的右键菜单
document.oncontextmenu = function (event) {
  event.preventDefault();
};
// 禁止ctrl 加 ‘+’ ‘-’ 缩放页面
document.addEventListener(
  "keydown",
  function (event) {
    if (
      (event.ctrlKey === true || event.metaKey === true) &&
      (event.which === 61 ||
        event.which === 107 ||
        event.which === 173 ||
        event.which === 109 ||
        event.which === 187 ||
        event.which === 189)
    ) {
      event.preventDefault();
    }
  },
  false
);
// 禁止ctrl+鼠标滚轮 缩放页面
window.addEventListener(
  "mousewheel",
  function (event: any) {
    if (event.ctrlKey === true || event.metaKey) {
      event.preventDefault();
    }
  },
  { passive: false }
);
</script>
<style lang="scss">
:root {
  --color-primary: theme("primary");
}
</style>
